<nz-spin [nzSpinning]="isSpinning" [nzTip]="'正在初始化模块信息...'">
  <section class="in-index" *ngIf="viewType==0 ">
    <div class="table-operations" style="margin: 16px 0;padding: 0 2%;">

      <button nz-button [disabled]="!allChecked && !indeterminate " (click)="joinCourse('',2)">
        <i class="anticon anticon-check-circle"></i>
        <span>通过</span>
      </button>
      <button nz-button [disabled]="!allChecked && !indeterminate " (click)="joinCourse('',3)">
        <i class="anticon anticon-close-circle-o"></i>
        <span>拒绝</span>
      </button>
      <button nz-button (click)="getEntityList()" [nzLoading]="loadingData">
        <i class="anticon anticon-reload"></i>
        <span>刷新</span>
      </button>
      <nz-radio-group [(ngModel)]="studentFilter" [nzDisabled]="loadingData">
        <label nz-radio-button nzValue="">全部</label>
        <label nz-radio-button nzValue="1">未审核</label>
        <label nz-radio-button nzValue="2">已通过</label>
        <label nz-radio-button nzValue="3">已拒绝</label>
      </nz-radio-group>
    </div>
    <nz-table #nzTable #nzFixedHeader nzBordered [nzLoading]="loadingData" [nzData]="listEntities.entities" [nzTotal]="listEntities.recordTotalCount"
      [(nzPageIndex)]="listEntities.currentPageIndex" (nzPageIndexChange)="getEntityListAsync($event)" [(nzPageSize)]="listEntities.pageSize"
      nzShowQuickJumper nzShowTotal [nzSize]="'middle'">
      <thead nz-thead>
        <tr>
          <th nzShowCheckbox [(nzChecked)]="allChecked" [nzIndeterminate]="indeterminate" (nzCheckedChange)="checkAll($event)" style="width: 60px;">
          </th>
          <th style="text-align: center;">
            <span>课程名称</span>
          </th>
          <th style="text-align: center;">
            <span>学生姓名</span>
          </th>
          <th style="text-align: center;">
            <span>加入状态</span>
          </th>
          <th nz-th style="text-align: center;">操作</th>
        </tr>
      </thead>
      <tbody nz-tbody style="text-align: center;">
        <tr nz-tbody-tr *ngFor="let item of nzTable.data">
          <td nzShowCheckbox [(nzChecked)]="item.IsChecked" (nzCheckedChange)="refreshStatus($event)">
          </td>
          <td nz-td>
            <span>{{item.className}}</span>
          </td>
          <td nz-td>
            <span>{{item.personName}}</span>
          </td>
          <td nz-td>
            <span *ngIf="item.applyType==0">
              <i class="anticon anticon-pause-circle"></i>未申请</span>
            <span *ngIf="item.applyType==1">
              <i class="anticon anticon-info-circle"></i> 审核中</span>
            <span *ngIf="item.applyType==2">
              <i class="anticon anticon-check-circle"></i>已加入</span>
            <span *ngIf="item.applyType==3">
              <i class="anticon anticon-close-circle"></i>已拒绝</span>
          </td>
          <td nz-td>
            <a (click)="joinCourse(item.id,2)" *ngIf="item.applyType==1 || item.applyType==3">
              <i class="anticon anticon-check-circle"></i>通过</a>
            <a (click)="joinCourse(item.id,3)" *ngIf="item.applyType==1 || item.applyType==2">
              <i class="anticon anticon-close-circle"></i>拒绝</a>
          </td>
        </tr>
      </tbody>
    </nz-table>
  </section>
</nz-spin>
